package com.xiaocz.hblsubstitutedriving.activities.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;

import com.xiaocz.hblsubstitutedriving.R;
import com.xiaocz.hblsubstitutedriving.base.BaseActivity;

/**
 * Author:  bozaixing.
 * Date:    2018/5/31.
 * Descr: 注册协议
 */
public class RegistrationProtocolActivity extends BaseActivity {

    private String title,contentValue;
    private TextView titleView;
    private WebView webView;
    public static void show(Context context, String content, String title) {
        Intent intent = new Intent(context, RegistrationProtocolActivity.class);
        intent.putExtra("VALUE",content);
        intent.putExtra("TITLE",title);
        context.startActivity(intent);
        //RegistrationProtocolActivity.show(mContext, "file:///android_asset/clause.html", "相关协议");
    }

    @Override
    protected int getLayoutSourceId() {
        return R.layout.activity_registration_protocol;
    }


    @Override
    protected void initWidgets() {
        titleView=findViewById(R.id.title);
        webView=findViewById(R.id.content);
        super.initWidgets();
    }

    @Override
    protected boolean initArgs(Bundle bundle) {
        contentValue=bundle.getString("VALUE");
        title=bundle.getString("TITLE");
        return super.initArgs(bundle);
    }

    @Override
    protected void initData() {
        super.initData();
        titleView.setText(title);
        //webView.getSettings().setDefaultTextEncodingName("gb2312");
        webView.loadUrl(contentValue);//加载asset文件夹下html
    }
}
